{% block sw_product_detail_seo %}
<div v-if="isLoading">
    <sw-skeleton variant="detail-bold" />
    <sw-skeleton />
</div>

<div v-else>
    {% block sw_product_detail_seo_general %}
    <mt-card
        position-identifier="sw-product-detail-seo"
        :title="$tc('sw-product.seo.cardTitleSeo')"
    >
        {% block sw_product_detail_seo_general_content %}
        <sw-product-seo-form
            ref="seoForm"
            :allow-edit="acl.can('product.editor')"
        />
        {% endblock %}
    </mt-card>
    {% endblock %}

    {% block sw_product_detail_seo_urls %}
    <sw-seo-url
        v-if="product.seoUrls"
        :has-default-template="false"
        :disabled="!acl.can('product.editor')"
        :urls="product.seoUrls"
        @on-change-sales-channel="onChangeSalesChannel"
    >
        {% block sw_product_detail_seo_urls_content %}
        <template #seo-additional="props">
            {% block sw_product_detail_seo_urls_content_seo_additional %}
            <sw-inherit-wrapper
                v-if="product.mainCategories"
                v-model:value="productMainCategory"
                :has-parent="!!parentProduct.id && !!props.currentSalesChannelId && product.categories.length === 0"
                :label="$tc('sw-seo-url.labelMainCategory')"
                :inherited-value="parentMainCategory"
            >

                <template #content="{ currentValue, isInherited }">
                    {% block sw_product_detail_seo_urls_content_seo_additional_edit %}
                    <sw-seo-main-category
                        :current-sales-channel-id="props.currentSalesChannelId"
                        :categories="categories"
                        :main-categories="isInherited ? parentProduct.mainCategories : product.mainCategories"
                        :overwrite-label="true"
                        :allow-edit="acl.can('product.editor') && !isInherited"
                        @main-category-add="onAddMainCategory"
                    />
                    {% endblock %}
                </template>

            </sw-inherit-wrapper>
            {% endblock %}
        </template>
        {% endblock %}
    </sw-seo-url>
    {% endblock %}
</div>
{% endblock %}
